<template>
  <div class="bottom-navigation-bar">
    <div
        v-for="(item, index) in items"
        :key="index"
        class="nav-item"
        @click="selectItem(index)"
    >
      <img class="nav-item-image" :src="selectedItem==index?item.image:item.image_activate">
      {{ item.label }}
    </div>
  </div>
</template>

<script>
export default {
  name: 'navigation',
  props: {
    items: {
      type: Array,
      required: true,
    },
    selectedItem: {
      type: Number,
      required: true,
    },
  },
  methods: {
    selectItem(index) {
      console.log(index)
      this.$emit('item-selected', index);
    },
  },
};
</script>

<style lang="scss" scoped>
.bottom-navigation-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background-color: white;
  color: black;
  height: 60px;
}

.nav-item {
  cursor: pointer;
  padding: 10px;
  display: flex;
  text-align: center;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 100;
  .nav-item-image{
    height: 25px;
    width: 25px;
  }
}
</style>
